/*************************************************
 * File name: sport_data.h
 * Description: 数据访问接口（链表/文件）
 *************************************************/
#ifndef SPORT_DATA_H__
#define SPORT_DATA_H__

#include "sport_type.h"

/* Project 链表 */
ProjectList  Project_LoadFromFile(const char *file_name);
int          Project_SaveToFile(ProjectList head, const char *file_name);
ProjectList  Project_Insert(ProjectList head, ProjectNode *node);
ProjectList  Project_Delete(ProjectList head, ProjectNode *node);
ProjectNode* Project_FindById(ProjectList head, const char *id);
int          Project_Count(ProjectList head);

/* Player 链表 */
PlayerList   Player_LoadFromFile(const char *file_name, int *p_serial);
int          Player_SaveToFile(PlayerList head, int serial, const char *file_name);
PlayerList   Player_Insert(PlayerList head, PlayerNode *node);
PlayerList   Player_Delete(PlayerList head, PlayerNode *node);
PlayerNode*  Player_FindBySerial(PlayerList head, const char *serial);
int          Player_Count(PlayerList head);

#endif